package com.radiation.rms.config;

import com.radiation.rms.controller.RadiationController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;

/**
 * @author 10626
 */
@Configuration
public class ApplicationEventListener implements ApplicationListener {
    @Autowired
    private RadiationController radiationController;
    @Override
    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        if (applicationEvent instanceof ApplicationReadyEvent) {
            System.out.println("项目启动完成！！");
            radiationController.initialize();
        }
    }
}
